<!DOCTYPE html>
<html  xmlns="http://www.w3.org/1999/xhtml"
       xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="refresh">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Favicon -->
    <link rel="shortcut icon" href="images/fav.png" type="image/x-icon">
    <link rel="icon" href="images/fav.png" type="image/x-icon">
    <!-- font-awesome -->
    <link href="css/font-awesome.css" rel="stylesheet">
    <!-- include the site stylesheet -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <!-- main stylesheet -->
    <link rel="stylesheet" href="css/style.css">
    <!-- responsive css -->
    <link rel="stylesheet" href="css/responsive.css">
    <!-- color css -->
    <link rel="stylesheet" href="css/colors.css">

    <title>注册</title>
    <script src="http://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <script>
        function resetForm()
        {
            $(':input', '#myForm')
            .not(':button, :submit, :reset, :hidden,:radio') // 去除不需要重置的input类型
            .val('')
            .removeAttr('text');
        }
    </script>
    <!--<style type="text/css">
        body{//清除样式,设置字体和背景
            margin: 0;
            padding: 0;
            font-family: sans-serif;
            background: #34495e;
        }
        .box{
            color: white;
            width: 300px;
            padding: 40px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-50%);
            background: #191919;
            text-align: center;
        }
        .box h1{
            color: white;
            text-transform: uppercase;
            font-weight: 500;
        }
        .box input[type ="text"],.box input[type="password"]{
            border: 0;
            background: none;
            display: block;
            margin: 20px auto;
            text-align: center;
            border: 2px solid #3498db;
            padding: 14px 10px;
            width: 200px;
            outline: none;
            color: white;
            border-radius: 24px;
            transition: 0.25s;
        }
        .box input[type ="text"]:focus,.box input[type="password"]:focus {
            width: 280px;
            border-color: #2ecc71;
        }
        .box input[type="reset"],.box input[type="submit"]{
            border: 0;
            background: none;
            display: block;
            margin: 20px auto;
            float: left;
            text-align: center;
            border: 2px solid #2ecc71;
            padding: 14px 30px;
            outline: none;
            color: white;
            border-radius: 24px;
            transition: 0.25s;
            cursor: pointer;
        }
        .box input[type="button"]{
            border: 0;
            background: none;
            display: block;
            margin: 20px auto;
            float: right;
            text-align: center;
            border: 2px solid #2ecc71;
            padding: 14px 30px;
            outline: none;
            color: white;
            border-radius: 24px;
            transition: 0.25s;
            cursor: pointer;
        }
        .box input[type="button"]:hover, .box input[type="submit"]:hover{
            background:#2ecc71 ;
        }
        .box input[type="reset"]:hover{
            background:#2ecc71 ;
        }
        .box span{
            color:red;
        }
        #errmsg{
            display: none;
            color: red;
        }
    </style>-->

</head>
<body>

<div id="wrapper">
    <!-- 顶部导航栏 -->
    <header class="new-block header">
        <!--
        <div class="topnav new-block">
            <div class="container">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="left-nav">
                            <div class="select-country">
                                <select class="nice-select">
                                    <option value="0">English</option>
                                    <option value="1">Hindi</option>
                                </select>
                            </div>
                            <div class="select-inr">
                                <select class="nice-select">
                                    <option value="0">USD</option>
                                    <option value="1">INR</option>
                                </select>
                            </div>
                        </div>
                        <div class="right-nav">
                            <span class="top-nav-signup_ligin">
                                <div th:if="${session.SPRING_SECURITY_CONTEXT != null}">
                                    <span th:text="${session.SPRING_SECURITY_CONTEXT.authentication.principal.username}"></span> / <a href="login">注销</a>
                                </div>
                                <div th:if="${session.SPRING_SECURITY_CONTEXT == null}">
                                       <a href="/regist">注册</a> / <a href="login">登录</a>
                                </div>
                            </span>
                            <a href="#" class="support-num">电话支持 : +1 (123 ) 456 789</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>-->
        <div class="main-nav new-block">
            <div class="overlay"></div>
            <div class="container-fluid pad0">
                <div class="row no-gutters">
                    <div class="col-lg-12">
                        <div class="logo">
                            <a href="/"><img src="images/logo2.png" alt="logo" class="img-responsive"></a>
                        </div>
                        <a href="#" class="nav-opener"><i class="fa fa-bars"></i></a>
                        <div class="nav-block">
                            <nav class="nav">
                                <ul class="list-unstyled">
                                    <li><a href="/">首页</a></li>
                                    <li><a href="search_girls.html">在线匹配</a></li>
                                    <li><a href="search_girls.html">自主择友</a></li>
                                    <li><a href="online_search_result.html">游戏娱乐</a></li>
                                    <li><a href="online_search_country.html">运动健身</a></li>
                                    <li><a href="blog.html">博客</a></li>
                                    <li><a href="../static/about_us.html">关于我们</a></li>
                                    <li><a href="../static/contact_us.html">联系我们</a></li>

                                    <span th:if="${session.SPRING_SECURITY_CONTEXT != null}">
											<li class="active drop">
												<a href="#" th:text="${session.SPRING_SECURITY_CONTEXT.authentication.principal.username}"></a>
												<ul class="drop-down">
													<li><a href="/logout">注销</a></li>
												</ul>
											</li>
										</span>
                                    <!--
                                    <span th:if="${session.SPRING_SECURITY_CONTEXT == null}">
                                        <li><a href="/regist">注册</a></li>
                                        <li><a href="login">登录</a></li>
                                        -->

                                    </span>
                                </ul>
                            </nav>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </header> <!-- header -->

    <div class="Regist-form new-block pd">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <div class="introducing-wrapper">

                    <div class="inner-wrapper">
                        <!--<form>
                            <div class="row">
                                <div class="col-lg-4 col-md-4">
                                    <label>I am a :</label>
                                    <div class="form-group">
                                        <select>
                                            <option value="" selected>Men</option>
                                            <option value="">Girl</option>
                                            <option value="">other</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4">
                                    <label>Looking For</label>
                                    <div class="form-group">
                                        <select>
                                            <option value="" selected>Choose Your Preferences</option>
                                            <option value="">Men</option>
                                            <option value="">Girl</option>
                                            <option value="">other</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4">
                                    <label>Location</label>
                                    <div class="form-group">
                                        <select>
                                            <option value="" selected>Choose Your Preferences</option>
                                            <option value="">Usa</option>
                                            <option value="">Uk</option>
                                            <option value="">India</option>
                                            <option value="">china</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="col-lg-4 col-md-4">
                                    <label>Age : <span id="result_1"> 18 - 25</span></label>
                                    <div class="form-group">
                                        <input id="range_1" />
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4">
                                    <label>Height : <span id="result_2"> 145cm - 210cm</span></label>
                                    <div class="form-group">
                                        <input id="range_2" />
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4">
                                    <label>Weight : <span id="result_3"> 40kg - 80kg</span></label>
                                    <div class="form-group">
                                        <input id="range_3" />
                                    </div>
                                </div>

                                <div class="col-lg-4 col-md-4">
                                    <label>Education :</label>
                                    <div class="form-group">
                                        <select>
                                            <option value="" selected>Graduate</option>
                                            <option value="">Post Graduate</option>
                                            <option value="">Studying</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4">
                                    <label>Social Status :</label>
                                    <div class="form-group">
                                        <select>
                                            <option value="" selected>Choose Your Preferences</option>
                                            <option value="">Facebook</option>
                                            <option value="">twitter</option>
                                            <option value="">whatsapp</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4">
                                    <label>Working in :</label>
                                    <div class="form-group">
                                        <select>
                                            <option value="" selected>All</option>
                                            <option value="">It sector</option>
                                            <option value="">business</option>
                                            <option value="">Multimedia</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="col-lg-4 col-md-4">
                                    <label>Marital Status :</label>
                                    <div class="form-group">
                                        <select>
                                            <option value="" selected>Single</option>
                                            <option value="">married</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4">
                                    <label>Smoking :</label>
                                    <div class="form-group">
                                        <select>
                                            <option value="" selected>Yes</option>
                                            <option value="">No</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4">
                                    <label>Drinking :</label>
                                    <div class="form-group">
                                        <select>
                                            <option value="" selected>Yes</option>
                                            <option value="">No</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-lg-12">
                                    <div class="text-center">
                                        <a href="#" class="c-btn btn1">Search</a>
                                    </div>
                                </div>
                            </div>
                        </form>-->
                        <form id="myForm" class="Regist"  method="POST" th:object="${user}" th:action="@{/regist_submit2}">

                            <!-- 验证失败 -->
                            <div  th:if="${#fields.hasErrors()}">
                             <div class="validationError">
                             </div>
                            </div>

                            <div class="row">
                                <h2>注册</h2>
                                <label>用户名</label>
                            </div>

                            <div class="row">
                            <div class="form-group">
                            <input class="form-control" type="text" th:field="*{name}" id="username" >
                            <span color="red"  class="validationError" th:if="${#fields.hasErrors('name')}" th:errors="*{name}"></span>
                                <div  th:switch="${result.code}">
                                    <!-- 注册失败显示出错信息：用户已被注册 -->
                                    <span  class="validationError" th:case="302" th:text="${result.msg}"></span>
                                    <!-- 注册成功弹窗提示并跳转 -->
                                    <div th:case="200">
                                        <script>
                                            alert("注册成功！");
                                            window.location.href="/";
                                        </script>
                                    </div>
                                </div>
                            </div>
                            </div>

                            <div class="row">
                            <label>密码</label>
                            </div>

                            <div class="row">
                            <div class="form-group">
                            <input  class="form-control" type="password" th:field="*{passwd}" id="password" >
                            <span class="validationError" th:if="${#fields.hasErrors('passwd')}" th:errors="*{passwd}"></span>
                            </div>
                            </div>

                            <div class="row">
                                <div class="">
                                    <div class="text-center">
                                    <input class="c-btn btn1 "  type="submit" id="btnSignin"  value="注册">
                                    <input  class="c-btn btn1 " type="button" onclick="resetForm()" value="重置">
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <span id="go_to_top" class="go-to-top"><i class="fa fa-long-arrow-up"></i></span>
    <div class="copyright new-block">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <div class="social-nav">
                        <ul>
                            <li class="tw"><a href="#"><i class="flaticon-twitter"></i></a></li>
                            <li class="fb"><a href="#"><i class="flaticon-facebook-logo"></i></a></li>
                            <li class="gp"><a href="#"><i class="flaticon-google-plus-logo"></i></a></li>
                            <li class="rss"><a href="#"><i class="flaticon-rss-symbol"></i></a></li>
                        </ul>
                    </div>
                    <p>2018 Design By <a href="http://www.bootstrapmb.com/"> Rewebso </a> All Rights Reserved</p>
                </div>
            </div>
        </div>

    </div>
</div>
<!-- Include jQuery -->
<script src="js/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="js/bootstrap.min.js"></script>
<!-- Plugins -->
<script src="js/plugins.js"></script>
<!-- Googleapis
<script src="http://ditu.google.cn/maps/api/js?key=AIzaSyBP1lPhUhDU6MINpruPDinAzXffRlpzzFo"></script>
-->
<!-- Custom -->
<script src="js/custom.js"></script>
</body>
</html>